home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amoszine 2
/
Amoszine 2.adf
/
MORE_SOURCE_CODE
/
med_with_sample.amos
/
med_with_sample.amosSourceCode
< prev
next >
Wrap
AMOS Source Code
|
1992-02-26
|
2KB
|
74 lines
'
' Med with samples
' By Edmund Clay
' June 94
'
' This cures the problem that all samples are looped after a med module
' has been loaded.
' I worked it out too late to save the samples in my last game
' (blatant plug) which was The Lost Prince, available now from CLR.
' At least I'll know next time...
'
'----------------------------------------------------------------------
'
' Load a med module...
'
Med Load "df0:module.med",6
'
' Play until mouse
'
Print "Playing module, click mouse to stop."
Med Play 6
While Mouse Key=0 : Wend
While Mouse Key<>0 : Wend
'
' Stop the module
'
Med Stop
Print "Click mouse to play sample."
Do
While Mouse Key=0 : Wend
While Mouse Key<>0 : Wend
'
' Play sample
'
SAM["%1111",1,10000,0]
Loop
'
' An interesting point is that this bug actually works to your advantage,
' because you can now choose whether to have individual samples looped or not,
' which AMOS doesn't normally allow.
' If you try to play samples at the same time as Med modules, you have no
' control over the frequency if med is using the same channel.
' Unfortunately this will have to wait for a proper fix.
'
Procedure SAM[VO1CE$,S4MPLE,FREQUENCY,L00P]
'
' Parameters as the normal sam play command.
' The voice bitmap has to be a string because I can't get btst to work.
' L00P=0 - not looped
' L00P=-1 - looped
'
'---------------------------------------------------------------------
'
' Play the sample
'
Sam Play Val(VO1CE$),S4MPLE,FREQUENCY
'
' This makes sure that the first word of the sample is zero, preventing
' nasty noises.
' Assumes that samples are in bank 5.
'
Doke Start(5)+Leek(Start(5)+2+4*(S4MPLE-1))+14,0
'
' This pokes values into the audio registers to stop the sample directly
' since sam loop off has no effect. Try removing these lines to see what
' happens.
'
If Not L00P
If Mid$(VO1CE$,5,1)="1" : Doke $DFF0A4,1 : End If
If Mid$(VO1CE$,4,1)="1" : Doke $DFF0B4,1 : End If
If Mid$(VO1CE$,3,1)="1" : Doke $DFF0C4,1 : End If
If Mid$(VO1CE$,2,1)="1" : Doke $DFF0D4,1 : End If
End If
End Proc